﻿@model IEnumerable<GsifWeb4.ViewModels.MatchStatPerson>

<!-- Avbytare -->
<table width="480" border="0">
    <tr valign="bottom">
        <td><b>Avbytare:</b></td>
    </tr>
    <tr valign="top">
        @{
            var players = Model.Where(stat => stat.Position > (int)ViewData["minPosition"] && stat.Position < (int)ViewData["maxPosition"]);

            if (players != null && players.Count() > 0)
            {
                var widthEach = Convert.ToInt32(480 / players.Count());
                for (int i = 0; i < players.Count(); i++)
                {
            <td width='@widthEach'></td>  
                }
            }
            else
            {
            <td width='100%'></td>  
            }
        }
    </tr>

    <tr>
    </tr>

    <tr>
        @{
            foreach (var player in players)
            { 
            <td align='left' colspan='1'>
                @{Html.RenderPartial("_MatchReportPlayer", player);}
            </td>
            }
        }
    </tr>

</table>
